package main

///*
//#include <stdlib.h>
//
//typedef int (*qsort_cmp_func_t)(const void* a, const void* b);
//extern int _cgo_qsort_compare(void* a, void*b);
// */
//import "C"
//import "unsafe"
//
//func Sort(base unsafe.Pointer, num, size int, cmp func(a, b unsafe.Pointer) int) {
//	go_qsort_compare_info.Lock()
//	defer go_qsort_compare_info.Unlock()
//
//	go_qsort_compare_info.fn = cmp
//
//	C.qsort(base, C.size_t(num), C.size_t(size),
//		C.qsort_cmp_func_t(C._cgo_qsort_compare),
//		)
//}
//
//func main() {
//	values := []int32{42, 9, 101, 95, 27, 25}
//
//	qsort.Sort(unsafe.Pointer(&values[0]), len(values), int(unsafe.Sizeof(values[0])),
//		func(a, b unsafe.Pointer) int {
//			pa, pb := (*int32)(a), (*int32)(b)
//			return int(*pa - *pb)
//		},
//		)
//}
